package org.example.service;

import org.example.entity.User;
import org.example.exception.ErrorEnum;
import org.example.exception.ServiceException;

import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;

public interface IService {

    default Map<String, Object> success(Object data) {
        Map<String, Object> map = new HashMap<>();
        map.put("code", ErrorEnum.SUCCESS.getCode());
        map.put("message", ErrorEnum.SUCCESS.getMessage());
        map.put("data", data);
        return map;
    }
    default Map<String, Object> success() {
        Map<String, Object> map = new HashMap<>();
        map.put("code", ErrorEnum.SUCCESS.getCode());
        map.put("message", ErrorEnum.SUCCESS.getMessage());
        return map;
    }
}
